
import java.awt.geom.Point2D;
import java.util.ArrayList;
import javax.swing.*;
public class IntersectionList extends AbstractListModel
{
private ArrayList<Point> array = new ArrayList<Point>();

    public IntersectionList()
    {
        super();
    }

    public Point getElementAt(int i)
    {
        return array.get(i);
    }

    public int getSize()
    {
        return array.size();
    }

    public void add(ArrayList<Point> a)
    {
        array = a;
        refresh();
    }

    public void refresh()
    {
        if(array.size() == 0) fireIntervalAdded(this,0,0);
        else fireIntervalAdded(this,0,array.size()-1);
    }

    public void removeAll()
    {
        array.clear();
        refresh();
    }
}